/* in e2studio, common_data.h internally includes rm_pmgr_api.h and rm_pmgr_b_instance.h */
#include "common_data.h"
void Hello_world(void *pvParameters)
{
 FSP_PARAMETER_NOT_USED (pvParameters);
 fsp_err_t err;
 WIFIReturnCode_t err_wifi;
 /* pmgr open - internally call add_sleep_constraint(..., PMGR_CONSTRAINT_POWER_RAM) to block sleep */
 err = g_pmgr_b_ins.p_api->open(&g_pmgr_b_ctrl, &g_pmgr_b_cfg);
 assert(FSP_SUCCESS == err);
 // add wake source
 RM_PMGR_B_set_wake_source(RM_PMGR_B_get_ctrl(), PMGR_WAKE_SOURCE_WIFI);
 // add constraint (RETENTION)
 g_pmgr_b_ins.p_api->add_sleep_constraint(RM_PMGR_B_get_ctrl(), PMGR_CONSTRAINT_POWER_RETENTION);
 err_wifi = WIFI_On();
 assert(eWiFiSuccess == err_wifi);
 // do my job or check if my job is done
 printf("Hello World job is done!\n");
 // remove constraint (RAM)
 g_pmgr_b_ins.p_api->remove_sleep_constraint(RM_PMGR_B_get_ctrl(), PMGR_CONSTRAINT_POWER_RAM);
 while (1)
 {
 vTaskDelay (1);
 }
}